package org.ilead.iserve.dao;

import java.util.List;

import org.ilead.iserve.model.User;

public interface IUserDAO {
	// property constants
	public static final String LOGIN_NAME = "loginName";
	public static final String PASSWORD = "password";
	public static final String USER_NAME = "userName";
	public static final String SEX = "sex";
	public static final String PHONE = "phone";
	public static final String QQ = "qq";
	public static final String EMAIL = "email";
	public static final String IMAGE = "image";
	public static final String STATE = "state";
	public static final String AREA_ID = "areaId";
	public static final String GROUP_NAME = "groupName";
	public static final String PERMISSION = "permission";
	
	public abstract void save(User transientInstance);

	public abstract void delete(User persistentInstance);
	
	public abstract void deleteById(Integer id);

	public abstract User findById(java.lang.Integer id);

	public abstract List findByExample(User instance);

	public abstract List findByProperty(String propertyName, Object value);

	public abstract List findByLoginName(Object uname);
	
	public abstract User findByLoginNameAndPassword(String loginName, String password);

	public abstract List findByAreaId(Object areaId);
	
	public abstract List findByState(Object state);

	public abstract List findAll();
	
	/**
	 * 查找大于该权限的用户
	 * @param permission 权限值
	 * @return
	 */
	public abstract List findByPermission(int permission);

	public abstract User merge(User detachedInstance);

	public abstract void attachDirty(User instance);

	public abstract void attachClean(User instance);
}
